Ubuntu 14.04
Sponsored Link

OpenStack Liberty : Configure Neutron (Control Node)
2015/12/27
 
Configure OpenStack Network Service (Neutron).
For this example, Install Neutron Server on Control Node which Keystone/Glance/Nova API are already installed, and Install DHCP Agent, L3 Agent, L2 Agent, Metadata Agent on Network Node, and also Install L2 Agent on Compute Node on here. ( it's possible to install on a server as All-in-One, though, if you want )
Neutron needs a plugin software, it's possible to choose it from some softwares. This example chooses ML2 plugin. ( this example selects LinuxBridge as a backend for the plugin )
                                |
+------------------+            |            +------------------------+
| [ Control Node ] |            |            |    [ Network Node ]    |
|     Keystone     |10.0.0.30   |   10.0.0.50|        DHCP Agent      |
|      Glance      |------------+------------|        L3 Agent        |
|     Nova API     |eth0        |        eth0|        L2 Agent        |
|  Neutron Server  |            |            |     Metadata Agent     |
+------------------+            |            +------------------------+
                            eth0|10.0.0.51
                      +--------------------+
                      |  [ Compute Node ]  |
                      |    Nova Compute    |
                      |      L2 Agent      |
                      +--------------------+

 
Configure Control Node on here.
[1] Add user or service for Neutron to Keystone.
# add neutron user (set in service project)

root@dlp ~(keystone)#
openstack user create --domain default --project service --password servicepassword neutron

+--------------------+----------------------------------+
| Field              | Value                            |
+--------------------+----------------------------------+
| default_project_id | ba3f5997c2474c13b36e6f6bc47a264c |
| domain_id          | default                          |
| enabled            | True                             |
| id                 | b2a9e7abe33646c888443b1035d42040 |
| name               | neutron                          |
+--------------------+----------------------------------+

# add neutron user in admin role

root@dlp ~(keystone)#
openstack role add --project service --user neutron admin
# add service entry for neutron

root@dlp ~(keystone)#
openstack service create --name neutron --description "OpenStack Networking service" network

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking service     |
| enabled     | True                             |
| id          | bb88fcb494aa4fbcaf7500ab5189db57 |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+

# define neutron server host

root@dlp ~(keystone)#
export controller=10.0.0.30
# add endpoint for neutron (public)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne network public http://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | f6aea8080dde40429903a67bbbe5c0d2 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | bb88fcb494aa4fbcaf7500ab5189db57 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://10.0.0.30:9696            |
+--------------+----------------------------------+

# add endpoint for neutron (internal)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne network internal http://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 81da5610a5734c36b9af229fd5a3ecf2 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | bb88fcb494aa4fbcaf7500ab5189db57 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://10.0.0.30:9696            |
+--------------+----------------------------------+

# add endpoint for neutron (admin)

root@dlp ~(keystone)#
openstack endpoint create --region RegionOne network admin http://$controller:9696

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | f480b807d25841a8bdd7fc79c4df577d |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | bb88fcb494aa4fbcaf7500ab5189db57 |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://10.0.0.30:9696            |
+--------------+----------------------------------+
[2] Add a User and Database on MariaDB for Neutron.
root@dlp ~(keystone)#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 41
Server version: 5.5.46-MariaDB-1ubuntu0.14.04.2 (Ubuntu)

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
create database neutron_ml2;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on neutron_ml2.* to neutron@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on neutron_ml2.* to neutron@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
[3] Install Neutron Server.
root@dlp ~(keystone)#
apt-get -y install neutron-server neutron-plugin-ml2 python-neutronclient
[4] Configure Neutron Server.
root@dlp ~(keystone)#
mv /etc/neutron/neutron.conf /etc/neutron/neutron.conf.org

root@dlp ~(keystone)#
vi /etc/neutron/neutron.conf
# create new

[DEFAULT]
core_plugin = ml2
service_plugins = router
auth_strategy = keystone
state_path = /var/lib/neutron
dhcp_agent_notification = True
allow_overlapping_ips = True
notify_nova_on_port_status_changes = True
notify_nova_on_port_data_changes = True
nova_url = http://10.0.0.30:8774/v2
rpc_backend = rabbit

[agent]
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf

# Keystone auth info
[keystone_authtoken]
auth_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = neutron
password = servicepassword

# MariaDB connection info
[database]
connection = mysql+pymysql://neutron:password@10.0.0.30/neutron_ml2

# Nova auth info
[nova]
auth_url = http://10.0.0.30:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = nova
password = servicepassword

[oslo_concurrency]
lock_path = $state_path/lock

# RabbitMQ connection info
[oslo_messaging_rabbit]
rabbit_host = 10.0.0.30
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = password

root@dlp ~(keystone)#
chmod 640 /etc/neutron/neutron.conf

root@dlp ~(keystone)#
chgrp neutron /etc/neutron/neutron.conf

root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini
# line 7: add ( it's OK with no value for "tenant_network_types" (set later if need) )

type_drivers = flat,vlan,vxlan
tenant_network_types =
mechanism_drivers = linuxbridge,l2population
extension_drivers = port_security
# line 119: uncomment & add

enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.IptablesFirewallDriver
# bottom line: uncomment

enable_ipset = True
root@dlp ~(keystone)#
vi /etc/nova/nova.conf
# add follows into [DEFAULT] section

network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
# add follows to the end : Neutron auth info

[neutron]
url = http://10.0.0.30:9696
auth_url = http://10.0.0.30:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
region_name = RegionOne
project_name = service
username = neutron
password = servicepassword
root@dlp ~(keystone)#
ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini

root@dlp ~(keystone)#
su -s /bin/bash neutron -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head"

root@dlp ~(keystone)#
initctl restart neutron-server

neutron-server start/running, process 13704
root@dlp ~(keystone)#
initctl restart nova-api

nova-api start/running, process 13731
 
Tweet